<template>
    <table>
        <tr>
            <td>门店名称</td>
            <td>
                <input type="text" v-model="info.name"/>
            </td>
        </tr>
        <tr>
            <td>分店名称</td>
            <td>
                <input type="text" v-model="info.deName"/>
            </td>
        </tr>
        <tr>
            <td>分店地址</td>
            <td>
                <input type="text" v-model="info.aderr"/>
            </td>
        </tr>
        <tr>
            <td>门店电话</td>
            <td>
                <input type="text" v-model="info.phone"/>
            </td>
        </tr>
        <tr>
            <td>门店信息</td>
            <td>
                <input type="text" v-model="info.info"/>
            </td>
        </tr>
        <tr>
            <td>门店状态</td>
            <td>
                <input type="radio" v-model="info.state" :value="true"/>营业
                <input type="radio" v-model="info.state" :value="false"/>停业
            </td>
        </tr>
    </table>
</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';
const route=useRoute();
const info=ref({
    "id": route.query.id,
  "name": "",
  "aderr": "",
  "deName": "",
  "phone": "",
  "info": "",
  "state": true,
})
onMounted(()=>{
    fantian();
})
const fantian=()=>{
    axios.get("https://localhost:7184/api/user/fantian?id="+info.value.id).then(res=>{
        info.value=res.data;
        
    })
}
// const add=()=>{
//     axios.post("https://localhost:7184/api/user/useradd",info.value).then(res=>{
//         if(res.data>0){
//             alert('成功');
//         }
//         else{
//             alert('失败');
//         }
//     })
// }
</script>

